package com.seezoon.infrastructure.tcp.jt808;


import com.seezoon.infrastructure.tcp.codec.JT808;
import com.seezoon.infrastructure.tcp.common.MessageField;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @see JT808#终端通用应答
 */
@Getter
@Setter
@ToString
public class JT0001 {


    @MessageField(desc = "对应的平台消息的流水号")
    private int responseMsgSerialNo;
    @MessageField(desc = "对应的平台消息的ID")
    private int msgId;
    @MessageField(desc = "结果：0.成功 1.失败 2.消息有误 3.不支持 4.报警处理确认")
    private short resultCode;

    public boolean isSuccess() {
        return resultCode == ResultCode.SUCCESS;
    }

    public static class ResultCode {

        public static final int SUCCESS = 0; //成功、确认
        public static final int FAILURE = 1;//失败
        public static final int MESSAGE_ERROR = 2;//消息有误
        public static final int NOT_SUPPORT = 3;//不支持
        public static final int ALARMA_CK = 4;//报警处理确认

    }
}